Multi-process model for cross-platform applications

ABSTRACT

A multi-process model to support compiling applications for multiple platforms is described. In one embodiment, applications designed for execution on a mobile platform can be ported to and/or compiled for execution on a desktop/laptop platform without requiring modification of the core program code of the mobile application. The mobile application is executed using a multi-process (e.g., two or more process) model in which the core mobile application program generates content that is displayed by a host process. The host process enables automatic translation of program calls to generate mobile user interface elements into program calls that generate user interface elements of the host platform. The translation can be performed using a multi-process (e.g., two or more process) model in which the core application program generates content that is displayed by a host process.

CROSS-REFERENCE

This application is a divisional of co-pending U.S. patent applicationSer. No. 16/143,404 filed Sep. 26, 2018, which claims priority to andthe benefit of U.S. Provisional Patent Application No. 62/679,833 filedon Jun. 3, 2018, the entire contents of which are incorporated herein byreference.

FIELD

Embodiments described herein relate generally to multi-platformapplications and frameworks and, more specifically, to preventingdeadlocks in a multi-process model for cross platform applications.

BACKGROUND OF THE DESCRIPTION

The term platform as used in a computer context can refer to the type ofprocessor and/or other hardware on which a given operating system orapplication program runs, the type of operating system on a computer orthe combination of the type of hardware and the type of operating systemrunning on that hardware.

The terms cross-platform, multi-platform, or portable, can be used todescribe operating systems and application programs that can run on morethan one platform. Multi-platform operating systems can refer tooperating systems that can be compiled or configured to run on multipleprocessor platforms. Multi-platform applications can refer toapplications that can be compiled or configured to run on multipleprocessor platforms and/or multiple operating systems. Multi-platformsoftware can be differentiated between platforms at compile time, whilesome software can perform runtime differentiation between platforms.

Applications or operating systems that are not multi-platform, in someinstances, can be ported between platforms. Porting describes thedevelopment of a version of an application or an operating systemoriginally designed for one platform such that the application oroperating system can be used on other platforms. The portability of asoftware project can vary based on the differences between the originand target platform. Porting a software project can involve changes tocore program code, as well as libraries or applications associated withthe program code.

SUMMARY OF THE DESCRIPTION

Embodiments described herein provide for a multi-process model tosupport compiling applications for multiple platforms. In oneembodiment, applications designed for execution on a mobile platform canbe ported to and/or compiled for execution on a desktop/laptop platformwithout requiring modification of the core program code of the mobileapplication. The mobile application is executed using a multi-process(e.g., two or more process) model in which the core mobile applicationprogram generates content that is displayed by a host process. The hostprocess enables automatic translation of program calls to generatemobile user interface elements into program calls that generate userinterface elements of the host platform. The translation can beperformed using a multi-process (e.g., two or more process) model inwhich the core application program generates content that is displayedby a host process.

One embodiment provides a method of displaying user interface elementsof an application via a multi-process model. The method compriseslaunching, on a second platform, a first process linked with a firstgraphical interface framework of a first platform, launching, on thesecond platform, a second process linked with a second graphicalinterface framework of the second platform, establishing aninter-process communication link between the first process and thesecond process, instantiating, by the first process, a first graphicalinterface element using the first graphical interface framework,instantiating, by the second process, a second graphical interfaceelement using the second graphical interface framework, and using theinter-process communication link, displaying the first graphicalinterface element within the second graphical interface element.

One embodiment provides for a non-transitory machine readable mediumstoring instructions which, when executed by one or more processors on ahost computing platform, cause the one or more processors to performoperations comprising establishing an inter-process communicationsession from a client application to a service process on the hostcomputing platform, accessing a protocol interface from the clientapplication that enables access to a service provided by the serviceprocess, wherein the protocol interface is associated with a remoteproxy of an implementation of the service, programmatically creating aremote instance of the implementation of the function via the remoteproxy, and invoking functionality provided by the service process at theclient application.

One embodiment provides for a data processing system comprising a memoryto store instructions for a multi-platform library and a multi-platformapplication and one or more processors to execute instructions inmemory. The instructions cause the one or more processors to load themulti-platform application for execution, wherein a first process of themulti-platform application includes program logic developed for a firstdevice platform and a second process of the multi-platform applicationincludes program logic developed for a second device platform; duringthe load of the multi-platform application, parse an object file of themulti-platform application to determine a set of symbols to resolve,wherein a first symbol in the set of symbols is associated with thefirst device platform and the second symbol in the set of symbols isassociated with the second device platform; resolve the first symbol andthe second symbol from the multi-platform library; and bind the firstsymbol and second symbol to the multi-platform application.

One embodiment provides for an electronic device that can implementmethods or operations described herein.

The above summary does not include an exhaustive list of all embodimentsin this disclosure. All systems and methods can be practiced from allsuitable combinations of the various aspects and embodiments summarizedabove, and also those disclosed in the Detailed Description below.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and notlimitation in the figures of the accompanying drawings in which likereferences indicate similar elements.

FIG. 1 illustrates a window system for a graphical interface;

FIG. 2 illustrates a multi-process model to support compilingapplications for execution on multiple platforms, according to anembodiment;

FIG. 3 is a sequence diagram that illustrates process, framework, and OSinteraction for a multi-process model application provided byembodiments described herein;

FIG. 4 is a method of displaying content for a ported application usingthe multi-process model, according to an embodiment;

FIG. 5-FIG. 9B illustrate execution of a mobile application on a hostplatform, according to embodiments described herein;

FIG. 10 illustrates an exemplary inter-process communication system;

FIG. 11A-11C illustrates a system in which an integrated IPC runtimeenables cooperative rendering, according to an embodiment;

FIG. 12A-12B illustrate remote invocation of service functionality at aclient application, according to an embodiment;

FIG. 13A-13C illustrate detailed views of multi-process applications,according to embodiments described herein;

FIG. 14A-14B illustrates interaction between system services and amulti-process application, according to embodiments described herein;

FIG. 15A-15B illustrate deadlock prevention for a multi-processapplication, according to embodiments;

FIG. 16A-16C are a flow diagram of a method of relaying messagesassociated with nested remote function invocations within amulti-process application, according to embodiments;

FIG. 17A-17B illustrate a system and method on a host platform to enableexecution of a hosted mobile application, according to embodimentsdescribed herein;

FIG. 18 is a block diagram illustrating an exemplary API architecture,which may be used in some embodiments of the invention;

FIG. 19A-19B are block diagrams of exemplary API software stacks,according to embodiments;

FIG. 20 is a block diagram of a device architecture for a mobile orembedded device, according to an embodiment; and

FIG. 21 is a block diagram of a computing system, according to anembodiment.

DETAILED DESCRIPTION

Various embodiments and aspects will be described with reference todetails discussed below, and the accompanying drawings will illustratethe various embodiments. The following description and drawings areillustrative and are not to be construed as limiting. Numerous specificdetails are described to provide a thorough understanding of variousembodiments. However, in certain instances, well-known or conventionaldetails are not described in order to provide a concise discussion ofembodiments.

Reference in the specification to “one embodiment” or “an embodiment”means that a particular feature, structure, or characteristic describedin conjunction with the embodiment can be included in at least oneembodiment. The appearances of the phrase “in one embodiment” in variousplaces in the specification do not necessarily all refer to the sameembodiment.

A portion of the disclosure of this patent document contains material towhich the claim of copyright protection is made. The copyright owner hasno objection to the facsimile reproduction by any person of the patentdocument or the patent disclosure, as it appears in the U.S. Patent andTrademark Office file or records, but reserves all other rightswhatsoever.

FIG. 1 illustrates a window system 100 for a graphical interface.Application software 101 can draw content in into window buffers. Thewindow system 100 can combine the window buffers in a frame buffer todisplay the corresponding windows on the screen. For example,application software 101 draws content in a window buffer 115 of anapplication window, which can be allocated in memory 111. A frame buffer121 contains data for the screen image of the windows that are displayedon the screen of a display device 105 of a computing device. The framebuffer 121 is typically under control of graphics hardware 103 (e.g., agraphics processing unit) which controls the display of the window 125on the screen of display device 105 using the data in the frame buffer.

Operations for creating the content in windows can be separated fromoperations for composing a screen image from images of windows fordifferent applications. A variety of applications can create or updateimages of the windows and/or content for the windows in window buffers.A window system (e.g., window manager) can then compose a screen imagefrom images of the windows in the various window buffers. The windowbuffers can be managed and drawn independently from the frame buffer.Content in the corresponding window buffers can be copied by the windowsystem to the corresponding locations in the frame buffer to display thewindows in these locations on the common screen of the display device.

FIG. 2 illustrates a multi-process model 200 to support compilingapplications for execution on multiple platforms, according to anembodiment. In one embodiment, the multi-process model 200 enables anapplication 201 to natively execute on an operating system and/orplatform that is different from the operating system and/or platform forwhich the application was originally designed. The application 201 canbe compiled for different platforms without requiring any significantmodifications to the core program code of the application. Theapplication 201 can execute as two or more processes, including a hostprocess 220 and a content process 230. The content process can be linkedagainst a variant of the original user interface (UI) framework of theapplication and the host process can be linked against the UI frameworkof the platform on which the application is to be executed. For example,in one embodiment program code for a mobile application that is designedfor execution on a mobile platform can be compiled for execution on alaptop or desktop platform. The program code for the mobile applicationcan be compiled to execute as the content process 230 and is linkedagainst a mobile UI framework 235 for the mobile platform. Duringexecution, the content process 230 can establish an inter-processcommunication link (IPC link 223) with the host process, which is linkedagainst a host UI framework 225. The host UI framework 225 can provideaccess to user interface elements for the platform on which theapplication 201 executes. The IPC link 223 can be established via avariety of inter-process communication methods including, but notlimited to sockets, pipes, ports, message queues, and shared memory. Inone embodiment, the IPC link 223 is established via the XPC frameworkprovided by Apple Inc. of Cupertino Calif. As described herein, aframework refers to one or more libraries that include objects, methods,data, and other information to facilitate various aspects of anapplication that is configured to execute on operating environmentsdescribed herein. In other embodiments the IPC link 223, or anequivalent connection, can be established over a remote procedure call(RPC) connection. While the application 201 is illustrated as includingtwo processes, the application 201 can include two or more processes toperform cross-platform operation. In one embodiment, the application 201can be a composite of multiple applications, each application havingmultiple processes.

The host UI framework 225 and the mobile UI framework 235 can eachprovide objects used by the host process 220 and the content process 230that are used to implement user interfaces on the respective platforms.The UI frameworks enable the generation and manipulation of windows,panels, buttons, menus, scrollers, and text fields, and the like, andhandle the details to of the operations used to draw to a display,including communicating with hardware devices and screen buffers,clearing areas of the screen before drawing, clipping views, etc.However, the host UI framework 225 and mobile UI framework 235 havefundamental differences that should be addressed to enable a mobileapplication linked against the mobile UI framework 235 to executecorrectly on the host platform. For example, some API calls, classes,and objects that serve similar functions differ between the mobile UIframework 235 and the host UI framework 225. Some functions, such asview animation, may differ between the mobile UI framework 235 and thehost UI framework 225. Additionally, the mobile UI framework 235, in oneembodiment, does not contain interfaces to manage the window server 205,which can be part of the operating system of the host (e.g., laptop,desktop, etc.) platform. Accordingly, the host UI framework 225 caninterface with the window server 205 on behalf of the mobile UIframework 235. The host UI framework 225 can communicate with the windowserver 205 to scale windows, allocate memory buffers for windows, renderinto window buffers, and generally perform operations to display windowscontaining UI elements for the application 201.

In one embodiment the host process 220, via the host UI framework 225and the window server 205, can generate and display a window frame 226,and menu bar 222, and status bar 224 on behalf of the content process230. The content process 230 can then use the mobile UI framework 235 tocreate data objects and data for a window buffer 232 that containscontent to be displayed for the application 201. Information to describeand/or reference the created data objects and data for the window buffer232 can be relayed via the IPC link 223 to the host process 220. Thehost process 220 can use the host UI framework 225 to modify details ofthe graphical elements that make up contents of the status bar 224, menubar 222, and window frame 226. The host process 220 can thenautomatically display the window buffer 232 created by the contentprocess within the window frame 226.

In one embodiment, details for the graphical interface elements to bedisplayed by the host process 220 can be determined automatically basedon metadata associated with the content process 230. For example, atitle for the window frame 226 can be determined based on the name ofthe content process 230 or the name of the mobile application on whichthe content process 230 is based. Some graphical elements of the statusbar 224 or menu bar 222 can also be automatically determined based onmetadata associated with the content process 230, or informationprovided by the content process via the IPC link 223.

In one embodiment, details for the graphical interface elements to bedisplayed by the host process 220 are determined interactively with thecontent process 230. For example, one or more elements of the menu bar222 that will be displayed by the host process 220 can be validated withthe content process 230 before display. Elements that do notsuccessfully validate can be grayed-out or otherwise marked asun-selectable when the menu bar 222 is displayed.

For embodiments described herein, exemplary mobile platforms from whichapplications can be ported include mobile phone, television set-top box,console gaming system, application enabled television, or tabletcomputing device platforms. In various embodiments, the mobileapplication code can be compiled and executed via binary translation orcan be compiled for direct execution by the processor within the laptopor desktop platform. In some embodiments, a common developmentenvironment can be provided for the mobile, laptop, and desktopplatforms. The common development environment can be configured toenable application code for a mobile application to be compiled forexecution on the laptop and desktop platform without requiringmodifications to the application code.

FIG. 3 is a sequence diagram that illustrates process, framework, and OSinteraction for a multi-process model application provided byembodiments described herein. A host operating system (host OS 330), inresponse to an application launch request, can send a message 332 tolaunch a multi-process model application, which initially results in thelaunch of the content process 230. The content process can send amessage 342 to the host OS 330 to launch the host process. The host OS330 can then send a message 334 to launch the host process 220. In oneembodiment the content process 230 can establish the IPC link (IPC link223 of FIG. 2) by sending a message 344 to the host OS 330, which cansend a message 335 to the host process, which causes the IPC link to beestablished at 321. In one embodiment the host OS 330 includes a processmanager responsible for launching applications or processes. The processmanager can manage the content process 230 and the host process 220automatically upon launch of a multi-process model application thatcontains the processes.

The IPC link being established, the host process 220 can perform anoperation 314 using the host UI framework 225 to create a host UIelement, such as a window frame and status bar elements. The contentprocess, via the mobile UI framework 235, can perform an operation 354to create a content UI element. An operation 346 to display the contentUI element is relayed via the IPC link to the host process 220, whichcan perform an operation 322 to display content within the host UI inconjunction with the host UI framework 225. For example, a pointer to awindow buffer containing content to be presented by the application canbe provided to the host process 220 via the IPC link, which can displaythe window buffer within the window frame created via the host UIframework 225.

In one embodiment the illustrated operations and messages are performedand transmitted transparently to the program code of the content process230. IPC messages performed during execution of the mobile applicationon the host platform, via the content process 230, can be transmittedautomatically by the host OS 330 and application frameworks, includingthe host UI framework 225 and mobile UI framework 235. The core programcode of the mobile application can execute normally, without requiringknowledge of the operations of the host process 220 and host UIframework 225.

A multi-process application can handle UI events using a variety oftechniques, depending on the nature of the UI event. A host UI framework225 can receive a UI event, such as a click event that will be processedby the content process 230. The host UI framework 225 can send a message324 to program code of the host process 220 upon receipt of UI input. Inone embodiment, the host process 220 can send a message 325 to relay theUI event to the mobile UI framework 235. In one embodiment, before theUI event is relayed, the specific type of UI event can be translatedfrom a UI event associated with the host UI framework 225, such as amouse click input, a touchpad input, or a multi-touch touchpad input, toa corresponding input event for the mobile UI framework 235, such as atouchscreen event or a multi-touch touchscreen event. The mobile UIframework 235 can then send a message 352 to trigger the appropriatesoftware event at the content process 230. In one embodiment, the hostprocess 220, upon receipt of the message 324 regarding the UI input, canperform an operation 326 to interpret the UI input. The host process 220can then send a message 328 directly to the content process 230 totrigger the appropriate software event. Additionally, some inputs may behandled directly by the host process 220 or the host UI framework 225.For example, a UI input to minimize the window in which the applicationis executed can be handled directly by the host UI framework 225.

FIG. 4 is a method 400 of displaying content for a ported applicationusing the multi-process model, according to an embodiment. The method400 can be performed by processes executing on a host processor of ahost platform, such as a laptop or desktop computing device.

In one embodiment, the method 400 includes to launch, on a hostplatform, multiple processes including a content process linked with agraphical interface framework of a mobile platform and a host processlinked with a graphics interface framework of the host platform, asshown at block 402. In one embodiment the content process is contentprocess 230 and the mobile UI framework 235 as described herein and asillustrated in FIG. 2 and FIG. 3.

The method 400 additionally includes to establish an inter-processcommunication link between the content process and the host process, asshown at block 404. The inter-process communication link can be, forexample, IPC link 223 as in FIG. 2.

The method 400 further includes to instantiate, by the content process,a first graphical interface element using the graphical interfaceframework of the mobile platform, as shown at block 406, and toinstantiate, by the host process, a second graphical interface elementusing the graphics interface framework of the host platform, as shown atblock 408. The host process can be host process 220, while the contentprocess can be content process 230, each illustrated in FIG. 2 and FIG.3.

The method 400 additional includes, using the inter-processcommunication link, to display, on the host platform, the firstgraphical interface element within the second graphical interfaceelement, as shown at block 410. The first graphical interface elementcan be application content within a window buffer. The second graphicalinterface element can be window frame. The window buffer containing theapplication content can be automatically displayed within the windowframe via the graphical interface of the host platform (e.g., host UIframework 225) without requiring modification of the content process towork with the graphical interface framework of the host platform.Instead the content process can use the graphical interface framework ofthe mobile platform (e.g., mobile UI framework 235) and have the createdgraphical UI elements automatically displayed via the host UI frameworkby the host process using the IPC link.

FIG. 5-FIG. 9B illustrate execution of a mobile application on a hostplatform, according to embodiments described herein. At least a subsetof mobile applications developed for a mobile platform can be compiledas multi-platform applications that can execute on a host platformprovided by laptop or desktop operating system. The host environment canprovide the same or similar library functionality as the mobileplatform, such that a multi-platform application can be compiled for amobile or host platform without requiring changes to the applicationsoftware.

FIG. 5 illustrates an exemplary mobile application 501 on an exemplarymobile platform 500. The exemplary mobile platform 500 illustrated inFIG. 5 is a tablet computing device. However, the illustrated conceptsapply to a variety of mobile platforms that may be embodied within ahandheld or embedded computing device, such as but not limited to asmart phones, television set-top box, console gaming system, applicationenabled television, or electronic kiosk. The mobile application 501 caninclude various graphical interface elements that are dynamicallyadaptable based on the type of mobile electronic device on which theapplication executes, or the size of display of the mobile electronicdevice, or one or more features of the mobile electronic device ordisplay of the mobile electronic device. For example, elements of thegraphical interface of the mobile application 501 can be dynamicallyconfigured based on the geometry of the display and the orientation ofthe mobile electronic device of the represented mobile platform 500.

In one embodiment, display of graphical user interface elements of themobile application 501 are facilitated via a user interface frameworkthat includes a collection of libraries that application program codecan use to display user interface elements on the display of the mobileelectronic device. A mobile user interface framework can provide a setof objects used to build mobile applications for execution on a mobileelectronic device. The provided set of objects can be used to displaycontent on the display of a mobile electronic device, to interact withdisplayed content, and manage interactions with the system.

FIG. 6 illustrates execution of a mobile application on a host platform600, according to an embodiment. The host platform 600 can be a laptopor desktop computing device on which a laptop or desktop operatingsystem can execute. In one embodiment, when the mobile application 501executes on the host platform 600, the graphical interface elements ofthe mobile application are translated into graphical interface elementsprovided by the graphical framework of the host platform 600. Forexample, graphical interface elements including, but not limited to amenu 602, window title 603, and dock icon 604 can be automaticallygenerated and displayed for the mobile application 501 during executionon the host platform 600. The graphical interface elements can begenerated based on data the core program code of the mobile application501 provides to a version of the mobile UI framework compiled forexecution on the host platform 600. The mobile UI framework on the hostplatform 600 can relay data to the host platform UI framework to enablethe display of graphical UI elements.

FIG. 7A-7B illustrates translation of mobile graphical elements intographical elements of the host platform 600, according to an embodiment.In one embodiment, some graphical elements that are produced by themobile UI framework are automatically translated into a graphicalelement provided by the host UI framework. For example, an API call fromthe core program code of the mobile application 501 to the mobile UIframework would generate graphical element 702 shown in FIG. 7A ifexecuted on a mobile platform (e.g., mobile platform 500 as in FIG. 5).Graphical element 702 of FIG. 7A can be translated 710 to graphicalelement 712 shown in FIG. 7B.

FIG. 8A-8B illustrates the handling of mobile UI framework features bythe host platform 600. In one embodiment, graphical element 802 (e.g., ashare icon) shown in FIG. 8A, upon interaction, can present graphicalelement 812, which is a share menu presented in the style of a menuprovided by the host UI framework, as shown in FIG. 8B.

FIG. 9A-9B illustrates translation of a search bar 901 on a mobileplatform into a search bar 910 for a host platform, according to anembodiment. As shown in FIG. 9A, a mobile platform 500 can display amobile application having a search bar 901. A user can type a searchterm into the search bar 901 using a software keyboard 902 provided bythe mobile platform 500. In response to typing the search term into thesearch bar 901, a set of results 904 can be displayed. In response toone or more touch interactions with text in the search bar, graphicalelement 903 is displayed which provides options to perform cut, copy,look up, or share operations using selected text.

As shown in FIG. 9B, similar functionality for the mobile application ismaintained when the application is executed on a host platform. Thesearch bar 901 and graphical element 903 is automatically translated atruntime to search bar 910 and graphical element 911, which enablesinteraction options available to other applications executing on thehost platform, including cut, copy, look up, and share options, as wellas other options that are presented to host platform applications.

In one embodiment, where supplemental hardware features are available onthe host platform, such as a touch bar 920, those supplemental hardwarefeatures are also available to mobile applications executing on the hostplatform.

Integrated Inter-Process Communication Framework

Returning to FIG. 2, the IPC link 223 shown in FIG. 2 allows a contentprocess 230 of a ported mobile application to communicate with a hostprocess 220 that enables the display of UI elements using the host UIframework 225. A communication connection can be established usingexisting inter-process communication techniques as shown in FIG. 10.

FIG. 10 illustrates an exemplary inter-process communication system1000. The inter-process communication system 1000 enables the buildingof an application package 1010 that contains core application logic 1012and inter-process communication service logic 1014. The IPC servicelogic 1014 is a helper tool that can be used to perform work on behalfof the core application logic 1012 to facilitate communication withother processes executing on the system. The IPC service logic 1014 ismanaged by a launcher daemon on the system. The launcher daemon canlaunch, restart, and terminate a process 1004 associated with the IPCservice logic 1014. Process 1004 is launched in response to the launchof process 1002 associated with the core application logic 1012.Functionality can be divided between the core application logic 1012 andthe IPC service logic 1014. Process 1002 associated with the coreapplication logic 1012 and process 1004 associated with the IPC servicelogic 1014 can exchange key-value data 1011 over a system managed IPCconnection 1006. To enable a multi-process system as shown in FIG. 2 inwhich a content process 230 communicates over an IPC link 223 with ahost process 220 using the inter-process communication system 1000 as inFIG. 10, a set of shims can be used to translate between the UIframeworks. For example, shim 1013 translates functionality provided by,for example, a mobile UI framework (e.g., mobile UI framework 235 as inFIG. 2) into key-value data 1011, which is then relayed over the IPCconnection 1006 and translated into functionality that can beimplemented using a host UI framework (e.g., host UI framework 225 as inFIG. 2). However, the types of data that can be relayed over the IPCconnection 1006 is limited and the implementation of the shims 1013,1015 may be time consuming and complex.

Embodiments described herein can provide an integrated inter-processcommunication framework that enables inter-process program logic whileabstracting the details of the inter-process communication channel. Inone embodiment, the integrated inter-process communication frameworkprovides a build time and run time framework that allows transparentimplementation of a shared inter-process communication protocol. Theintegrated inter-process communication framework also enables processesusing different runtimes to communicate over programming interfaceswithout regard to binary interface differences between the runtimes.Accordingly, cross-process workloads can be performed using multipleruntime libraries that may not be ABI compatible, as ABI differences canbe resolved transparently at the IPC interface.

FIG. 11A-11B illustrates a system 1100 in which an integrated IPCruntime 1115 enables cooperative rendering, according to an embodiment.As shown in FIG. 11A, in one embodiment the system 1100 includes arenderer client process 1110 and a service provider 1120, which areprogrammatically connected via an implementation of the integrated IPCruntime 1115. The renderer client process can provide renderingfunctionality for a process via a display system 1112 of the platform.In one embodiment the renderer client process 1110 can accessfunctionality provided by a renderer framework 1116. The rendererframework 1116 can enable the renderer client process 1110 to generateand manipulate graphical elements for display via the display system1112. The service provider 1120 can provide content that is rendered bythe renderer client process 1110. The service provider 1120 can generatecontent using functionality provided by one or more service framework(s)1126. A service IPC handler 1122 of the service provider 1120 can assistthe integrated IPC runtime 1115 in creating the IPC channel over whichdata flows between the renderer client process 1110 and the serviceprovider 1120. The specific details of the IPC channel of the IPCruntime 1115 can vary based on the type of inter-process communicationchannel being used, with different IPC channels configurable via the useof different instances of the service IPC handler 1122. In oneembodiment, the IPC channel is an XPC channel, although other IPCtechnologies are used in other embodiments.

In one embodiment the integrated IPC runtime 1115 is implemented via theuse of a plug-in model. A plugin to enable an integrated IPC runtimeinterface 1114 is included in the renderer client process 1110, while anintegrated IPC runtime service 1124 is included in the service provider1120. A bi-directional communication channel can be created at runtimevia the integrated IPC runtime 1115 to enable communication between therenderer client process 1110 and the service provider 1120. Theimplementation details of the bi-directional communication channel canbe abstracted way from the renderer client process 1110 and the serviceprovider 1120. Instead, each process can access functionality providedby the other process as though the processes were corresponding runtimelibraries. Functions, classes, methods, and other functionality withinthe service provider 1120 can be called by the renderer client process1110. Functionality within the renderer client process 1110 can becalled by the service provider 1120. Data and state information toenable cross-process functionality can be relayed over the integratedIPC runtime 1115 between the integrated IPC runtime interface 1114 andthe integrated IPC runtime service 1124.

The illustrated system 1100 of FIG. 11A can be used to implement avariety of cross-process functionality. In some embodiments, it isbeneficial to divide program functionality across multiple processes,such that the privilege level of each process can be narrowly tailoredto the needs of the process, enabling better implementation of theprinciple of least privilege. Additionally, a multi-process model ismore resilient to crashes. For example, if the renderer client process1110 were to fail, that process can be immediately restarted by thesystem without negative impact to the service provider. The use of theintegrated IPC runtime 1115 can allow communication between suchprocesses to be performed in a more robust manner, enablingfull-featured programming language functionality and interoperabilitybetween the processes.

In one embodiment, the integrated IPC runtime 1115 can enableaccelerated graphics and compute functionality within a simulatorenvironment. For example, where a simulator running on a host platformis used to enable the development of software for other platforms, suchas a mobile platform, hardware acceleration of display and/or 3Dgraphics functionality may be limited. Enabling hardware acceleration ofsuch functionality may require extensive use of shim or translationlayers that may be difficult and time consuming to implement. In oneembodiment, the integrated IPC runtime 1115 plugins can be used toextend graphical user interface (GUI) and 3D acceleration provided bythe host platform to applications executing in a simulated environmentby configuring a link between a simulator application and a rendererservice provider having access to a GUI or 3D acceleration framework. 3Dor GUI function calls to the GUI or 3D accelerator framework can betransparently relayed over the IPC channel of the integrated IPC runtime1115. Furthermore, the integrated IPC runtime 1115 can be used to enablethe multi-process model to support ported applications as describedherein. In one embodiment the integrated IPC runtime 1115 can also beused for accelerated multimedia (audio and video playback) and to enablecontrol input from joysticks, game controllers, and the like.

FIG. 11B illustrates elements of the integrated IPC runtime 1115,according to one embodiment. In one embodiment, remote invocationmessages 1150 are sent between the integrated IPC runtime interface 1114and the integrated IPC runtime service 1124 using an inter-processcommunication channel as a transport medium. The remote invocationmessages 1150 enable the remote invocation of methods and objects acrossprocesses using proxy execution state.

In one embodiment the IPC connection over which the remote invocationmessages 1150 are transmitted is managed by session managers 1130, 1140in each side of the connection. The session managers 1130, 1140 cancreate an IPC connection, configure event queues 1137, 1147 and eventhandlers 1138, and establish proxy connections for each plugin (e.g.,remote proxy 1136, forwarding proxy 1146). The session managers 1130,1140 can send and receive remote invocation messages 1150 and directlyperform operations based on those messages or insert workloads intodispatch queues 1132, 1142. Remote proxies of objects can be invokedprogrammatically as through the remote proxy were local. In oneembodiment, dispatch queue 1132 and dispatch queue 1142 can representproxy views of the same logical queue, where the logical queue has stateinformation that is reflected via state information 1134, 1144 at eachendpoint. In one embodiment, state information 1134, 1144 includes localexecution state and proxy state for remote invocations.

In one embodiment, cross-process functionality can be performed via theuse of dispatch queues that can be used to exchange self-containedblocks of functionality between processes. The IPC connection can beused to enable a dispatch queue 1132 within the integrated IPC runtimeinterface 1114 can exchange workload requests with a dispatch queue 1142within the integrated IPC runtime service. State information 1134, 1134associated with the dispatch queues 1132, 1142 can also be relayed overthe IPC connection. In one embodiment, dispatch queues 1132, 1142 andstate information 1134, 144, and other data associated with each end ofthe IPC connection are synchronized via proxies on each end of the IPCconnection.

The IPC integrated IPC service interface 1114 and integrated IPC runtimeservice 1124 can be used to implement specific programming languagefunctionality. In one embodiment, functionality provided by theObjective-C programming language or the Swift programming language canbe enabled. For example, Objective-C blocks and Swift closures can beexchanged over the IPC connection as remote invocation messages 1150.Additionally, Swift completion handlers can also be used to providedprogram logic that can automatically run after the completion of otherrequested functionality. Objective-C and Swift are provided as examplelanguages supported by one embodiment and the calling semantics of anyprogramming language can be supported.

FIG. 11C is a method 1160 for relaying programmatic functionalitybetween processes, according to an embodiment. The method 1160 can beimplemented by a processor of a computing system based on instructionsprovided by the integrated IPC runtime described herein. The method 1160enables a block of instructions, or other commands, to be relayed by aclient for implementation at a server. In one embodiment, the method1160 is performed to enable remote invocation of messages as shown inFIG. 11B.

In one embodiment, the method 1160 includes to receive a message at afirst library component, the message including a set of instructions tobe executed by a second library component, as shown at block 1162. Themethod 1160 additionally includes to store the set of instructions on afirst queue at the first library component, wherein the first queue is aremote instance of a second queue at a second library component, asshown at block 1163. The method 1160 further includes to transmit stateinformation for the first queue to a second library component, as shownat block 1164. The state information can include the set of instructionsand can be transmitted over an inter-process communication link that istransparent to the first library component. The method 1160 canadditionally include to receive the state information at a second queueat the second library component and updating the second queue with thestate information, as shown at block 1165. The method 1160 can thendispatch the set of instructions for execution at the second librarycomponent, as shown at block 1166.

FIG. 12A is a block diagram of program logic to enable remote invocationof service functionality at a client application, according to anembodiment. In one embodiment, a client application 1210 can remotelyinvoke functionality provided by a service 1220 over a protocol 1252.The protocol 1252 can be used to define functionality that will beremotely accessible to the client application 1210 over the IPCconnection 1250. The forwarding proxy 1146 links the protocol 1252 withthe service implementation 1222. The service implementation 1222implements the underlying functionality that is accessed by the clientapplication 1210. The remote proxy 1136 in the client application 1210links the protocol 1252 with the remote instance 1212 of the servicefunctionality that is accessed by the client application 1210. Theprogram logic of the client application 1210 can create a remoteinstance 1212 of the service functionality by converting the remoteproxy 1136 to the data type of the service interface exposed via theprotocol 1252 and the forwarding proxy 1146 within the service 1220. Theremote instance can then be invoked in the same manner as the serviceimplementation 1222 within the service 1220.

In one embodiment, the remote implementation models for objects canvary, and objects can be implemented remotely across processes using oneof multiple models. In one embodiment an object can be snapshotted, suchthat a persistent view of the object can be sent across the IPCconnection 1250 when the object is remotely accessed. In one embodimentan object can be impersonated, such that an opaque identifier (e.g.,UUID, integer) can be used to represent a conceptual object on each sideof the IPC connection 1250. Programming interfaces can reference theopaque identifier to explicitly select an object to access.Impersonation can be used to remotely present an entire class interface.If a class implements a protocol and the protocol is implemented overthe interface, remote function calls can be made that automaticallytraverse the IPC connection 1250. In one embodiment, objects can beconfigured to perform custom serialization and deserialization of dataon that traverses the IPC connection 1250, which allows the streaming ofdata over the IPC connection 1250. In one embodiment, objects can beconfigured that can interpose program logic before data is transmittedover the IPC connection 1250, which can be used to enable specialhandling of data or function calls. For example, if a group ofasynchronous messages are to be transmitted over the IPC connection,interposing program logic can be configured that bundles theasynchronous messages before transmission. In one embodiment,interposing logic can be configured as part of the protocol 1252 whichrelays data over the IPC connection 1250. Interposing logic can be ofparticular use to the client application 1210, which use an interposerto intercept and adapt any function call made by the client application1210 to the service implementation 1222.

FIG. 12B is a method 1230 remotely invoking programmatic functionalitybetween processes, according to an embodiment. The method 1230 can beimplemented by a processor of a computing system based on instructionsprovided by the integrated IPC runtime described herein. The method 1230enables an object provided by a service module to be remotely invoked bya client application as though the object is a local object.

As shown at block 1232, the method 1230 can establish an IPC sessionfrom a client application to a service process on a computing device. Asshown at block 1234, the method 1230 can access a protocol API from theclient application that enables access to a service provided by theservice process, the protocol API associated with a remote proxy of animplementation of the service. At block 1236, the method 1230 canprogrammatically create a remote instance of the implementation of theservice via the remote proxy to the implementation of the service. Atblock 1238, the method 1230 can invoke functionality provided by theservice at the client application. Programmatic remote access to avariety of services can be enabled, including any data, function, ormethod within the service process.

The method 1230 of FIG. 12B can be used to enable the automatictranslation and display by a host process of graphical elements that aregenerated by a content process, as illustrated in FIG. 2. For example,the content process 230 of a ported mobile application can establish theIPC link 223 and access functionality provided by the host process 220via a variant of method 1400. One or more protocols can be establishedsuch that a function call based on object provided by the mobile UIframework 235 can be invoked by the content process 230 and thenecessary adjustments to the parameters and data of the function callcan be automatically performed and the parameters and data can berelayed over the IPC link 223 to be performed by the host process 220.The host process 220 can receive the adjusted parameters and data andcall services enabled via the host UI framework 225 to present graphicalelements of the content process 230 as though those graphical elementswere native to the host platform.

FIG. 13A-13C illustrate detailed views of multi-process applications1300, 1340, 1350 according to embodiments described herein. FIG. 13Aillustrates a multi-process application 1300 in which mobile applicationlogic executes on a hosted platform. FIG. 13B illustrates amulti-process application 1340 in which a user interface is displayedfor remotely executed application logic. FIG. 13C illustrates amulti-process application 1350 in which a virtual application displays auser interface on a host platform.

The multi-process application 1300 of FIG. 13A is a version of themulti-process application 201 shown in FIG. 2. In one embodiment themulti-process application 1300 includes a content process 1320 and ahost process 1330, which are variants of the content process 220 andhost process 230, which are programmatically connected via animplementation of the integrated IPC runtime 1115. The content process1320 can generate content for display using encapsulated mobileapplication logic 1316, which is program code of a mobile applicationthat can be compiled for execution on a mobile platform. The mobileapplication logic 1316 can generate content for display using logicprovided by a mobile UI framework 1335. The logic of the mobile UIframework 1335 can be included by dynamically linking the mobile UIframework 225 of FIG. 2. The host process 1330 can display contentcreated by the content process 1320 using logic provided by a host UIframework 1325. The logic of the host UI framework 1325 can be includedby dynamically linking the host UI framework 235 of FIG. 2.

The integrated IPC runtime 1115 can be implemented with the support of ahost application services IPC module 1326, which provides functionalityused to set up an operate an IPC connection established by theintegrated IPC runtime 1115. The specific details of the IPC channel ofthe IPC runtime 1115 can vary. For example, the host applicationservices IPC module 1326 can enable the use of an XPC channel, althoughother IPC technologies can be used in other embodiments, and thetechniques described herein are not limited to any one IPCimplementation. Additionally, the IPC connection and underlyingimplementation is transparent to the mobile app logic 1316.

In one embodiment the host application services IPC module 1326 cantranslate function calls and data associated with the mobile UIframework 1334 into function calls and data that are compatible with thehost UI framework 1325. The mobile application logic 1316 can functionas though the logic is operating on a mobile platform. Calls via themobile UI framework 1335 made by the mobile application logic can berelayed to and translated by the host application services IPC module.Those calls can then be performed by logic of the host UI framework1325. The mobile app logic 1316 can send and receive remote invocationmessages 1150 to the host process 1330 via a host application servicesclient interface 1314, which is a plugin that implements the integratedIPC runtime interface 1114 as in FIG. 11. At the host process 1330,remote invocation messages 1150 can be sent and received by a hostapplication services module 1324, which is a plugin that implements anintegrated IPC runtime service 1124 as in FIG. 11.

The multi-process application 1300 can operate as a tiered system, withthe integrated IPC runtime 1115 operating as an internal processcommunication tier, the UI framework communication and translationservices interface enable communication between the mobile UI framework1335 and the host UI framework 1325. The multiple process of themulti-process application 1300 can be bundled and executed on the hostplatform as though the application is entirely native to the hostapplication platform.

The multi-process application 1340 of FIG. 13B uses techniques providedby embodiments described herein to enable local display of a userinterface for remotely executed application logic. In one embodiment,multiple processes can operate in a distributed manner by relayingremote invocation messages over an integrated RPC runtime 1345, which isa variant of the integrated IPC runtime 1115 in which IPC calls arerelayed over an RPC interface.

In one embodiment, remote application logic 1317 that is configured tooperate via a remote UI framework 1336 can use the host applicationservices client interface 1314 to remotely display a user interface. Theremote application logic 1317 can execute as part of a content process1321 that executes on a remote device 1342. The UI of the contentprocess 1321 can be displayed on a host process 1331 that executes on ahost device 1347. The remote application logic 1317 can use theintegrated RPC runtime 1345 to invoke remote program logic in the samemanner in which the program logic can, for example, invoke localdynamically linked program logic. The remote application logic 1317 canprogrammatically access functionality provided by the remote UIframework 1336 and the programming language semantics can be relayed viathe integrated RPC runtime 1345 and executed by the host process 1331using functionality provided via the host UI framework 1325.Functionality to enable the integrated RPC runtime 1345 to operate overthe RPC connection can be provided via a host application services RPCmodule 1327. Any number of RPC protocols can be used to relayfunctionality. In one embodiment, the specific RPC protocol isdetermined based on the protocol enabled by the host applicationservices RPC module 1327.

In one embodiment, the remote device 1342 can be the same type ofplatform or a different type of platform as the host device 1347. Forexample, the remote application logic 1317 can be mobile applicationlogic developed for a mobile platform or can be host application logicthat is developed for execution on a host platform, such as the hostdevice 1347. While the remote application logic 1317 executes on theremote device 1342, the instructions to display the UI for suchapplication are executed by the host device. Accordingly, the UIdisplayed in response to operations performed by the remote applicationlogic 1317 is rendered by the host device 1347 and can appear identicalto the UI of an application executed entirely on the host device 1347.

In one embodiment, the integrated RPC runtime 1345 can be leveraged toenable a distributed version of the content process 1320 in which someoperations of the content process 1321 are executed on a first instanceof the remote device 1342 while other operations are executed on asecond instance of the remote device 1342. Each remote instance of thecontent process 1321 can use the integrated RPC runtime 1345 to relay UIcommands that are executed via the host UI framework 1325 on the hostdevice 1347. For example, and in one embodiment, a cloud-baseddevelopment environment can execute in a distributed manner acrossmultiple cloud-based servers while the UI of such environment isrendered locally on the host device 1347.

The multi-process application 1350 of FIG. 13C uses techniques providedby embodiments described herein to enable an application executed withina virtual machine environment 1352 to render a user interface for theapplication using the host UI framework on a host platform 1357 thatexecutes the virtual machine hypervisor. In one embodiment, virtualapplication logic 1318 that is configured to operate via a virtual UIframework 1337 can use the host application services client interface1314 to display a user interface on the host platform 1357 on which thevirtual machine environment 1352 operates. The UI of the content process1322 can be displayed on a host process 1332 that executes on a hostdevice 1357. The virtual application logic 1318 can use the integratedhyper-call runtime 1355 to invoke remote program logic in the samemanner in which program logic can be invoked from a process of adifferent platform type or a remotely executed process. In oneembodiment the virtual application logic 1318 can programmaticallyaccess functionality provided by the virtual UI framework 1337 and theprogramming language semantics can be relayed via the integratedhyper-call runtime 1355 and executed by the host process 1332 usingfunctionality provided via the host UI framework 1325. Functionality toenable the integrated hyper-call runtime 1355 can be provided via a hostapplication services hypervisor module 1327, which can enable supportfor relay of remote invocation messages to a hypervisor for the virtualmachine environment 1352. The messages, once received at the hypervisor,can be translated and relayed to the host UI Framework 1325 via the hostapplication services module 1324. The UI displayed in response tooperations performed by the virtual application logic 1318 is renderedby the host platform 1357 and can appear identical to the UI of anapplication executed entirely on the host device 1357.

FIG. 14A-14B illustrates interaction between system services and amulti-process application, according to embodiments described herein. Asshown in FIG. 14A, in one embodiment a UI system app 1410 facilitatesthe bridging of interactions between the content process 1320 and thehost process 1330. The system launcher service can perform a fosterlaunch process 1422 for the content process 1320, which will launch andestablish a connection with a foster module 1414 of the UI systemapplication 1410. The system launcher can then perform an adopt launchprocess 1432 for the host process 1330, which will establish aconnection with an adopt module 1412 within the UI system app 1410. Thefoster-adopt process enables a multi-process application, which is acombination of multiple applications, to operate as a singleapplication. Window controller interaction and window frame generationare handled by the host process 1330. Content generation is handled bythe content process 1320. The system application 1410 can then create awindow controller scene 1416 and notify the content process 1320 andhost process 1330 that application operations can begin.

As shown in FIG. 14B, system input 1436A-1436B from the host platformcan be handled using multiple techniques. In one embodiment, some typesof system input 1436A is handled differently by the host platformrelative to the mobile platform, while some system input 1436B can berelayed more directly.

For example, an open URL command can be received as system input 1436A,which is communicated to the host application services IPC module 1326.The host application IPC services module 1326 can translate the inputand relay the command to a system input handler 1430 in the UI systemapplication 1410. The system input handler 1430 can then send an actionto the content process 1320 to open the URL. In this manner, systeminput 1436A can be delivered by the system in a format that is native tothe host platform and then translated into the input expected by thecontent process 1320. The action transmitted by the system input handlerto the content process 1320 is the same action that would be receivedwere the content process executing on a mobile platform.

In one embodiment, some types of system input 1436B can be transmitteddirectly to the UI system app 1410 from a system module of the hostplatform, where those modules are configured for multi-platformoperation. System input 1436B can be sent directly to the system inputhandler 1430 of the UI system app 1410 without traversing the hostapplication IPC services module 1326. For example, some types of remotenotifications to the content process 1320 can be delivered directly tothe system input handler 1430 within the UI system app 1410.

FIG. 15A-15B illustrate deadlock prevention for a multi-processapplication, according to embodiments. As shown in FIG. 15A, a contentprocess 1510 can communicate with a host process 1520 to display contenton a host platform. In one embodiment, the content process 1510 and thehost process 1520 engage in synchronous communication via remoteinvocation messages that are transmitted over one or more inter-processcommunication techniques described herein. The content process 1511includes a main queue 1511, which is an event processing run loop thatis used to schedule work and coordinate the receipt of incoming eventsat the content process 1511. The host process 1520 also includes a mainqueue 1521 that functions as an event processing run loop. Duringoperation of the main queues 1511, 1521, the process run loop is calledwhenever an event is detected that corresponds to a configured mode forthe run loop. The run loop of a main queue of the processes can monitorsources of input to a task and dispatch control when those inputs becomeready for processing. Examples of input sources can include user inputdevices, network connections, periodic or time-delayed events, andasynchronous callbacks.

The interaction of operations of the content process 1510 and the hostprocess 1520 may present a scenario in which deadlocks may arise whenthe content process 1510 and the host process 1520 each become dependentupon operations performed by the other process. For example, during aniteration of the main queue 1511 of the content process (RunLoop.run1515), the content process 1510 can invoke an operation of the hostprocess (Host.operationA( ) 1514). The remote invocation operation A atthe content process 1511 results in the relay of messages over an IPCchannel to the host process 1520, triggering an event in the main queue1521 of the host process 1521. Execution of operation A at the hostprocess (self.operationA( ) 1524) may require a call into operation B onthe content process (content.operationB( ) 1523), triggering a call backto the content process 1510, where run loop invocation 1513 triggers acall to operation B 1512. At this point, a deadlock can occur within themain queues 1511, 1521 of each process 1510, 1520. Proxy operation callsbetween processes operate in the same manner is conventional functioncalls. The calls between processes are synchronous and that forwardprogress of each process is halted while waiting for the results of apending proxy function call. Thus, if a scenario arises in which eachprocess 1510, 1520 is waiting on output of the other, neither can makeforward progress and a deadlock occurs. Such scenario can occur duringuser interface operations such as changing a pointer cursor, whengenerating and validating menu elements for a menu bar or performingother operations that require synchronous interaction between thecontent process 1510 and the host process 1520.

Embodiments described herein can avoid inter-process deadlocks via theaddition of background queues 1516, 1526 to each process 1510, 1520. Ingeneral, user interface events are processed in the main queues 1511,1521 due to the interactive nature of those events. However, thebackground queues 1516, 1526 added to the content process 1510 and the1520 are special purpose background queues that are used to enableinter-process interactivity between the processes during certain UIevents to enable mutual reentrancy during synchronous interactionwithout blocking the run loops of the main queues 1511, 1521. In oneembodiment, the background queues 1516, 1526 enable the stacking andunwinding of IPC operations 1517, 1527 during nested calls. When a proxyfunction call to another process of a multi-process application isinitiated the run loop of the main queue 1511, 1521 of the process canbe placed into a special operation mode that accepts IPC requests fromother processes of the multi-process application, but otherwise does notallow conventional event processing to proceed.

For example, in one embodiment a UI operation, such as an operation thatoccurs during a menu item validation event, can be processed in the mainqueue 1511 of the content process 1510. To handle the event, a proxyinvocation of operation A (Host.operationA( ) 1514) is called by thecontent process 1510, which triggers a remote invocation call via one ormore IPC operations 1517. In one embodiment, the one or more IPCoperations 1517 can be placed in the background queue 1516 and a servicethread associated with the content process 1510 can transmit messagesassociated with the IPC operations 1517 to the host process 1521. In oneembodiment, when the one or more IPC operations 1517 are associated withhigh priority (e.g., interactive) tasks, for example, when themulti-process application is an active foreground application, the oneor more IPC operations 1517 are sent from the main queue 1511. Sendingfrom the main queue 1511 enables priority donation to be performed toprevent a priority inversion. Although the operation is a synchronousoperation, the messages associated with the IPC operations 1517 can betransmitted asynchronously so as to not block the run loop of the mainqueue 1511. A service thread associated with the host process 1520 canreceive the messages associated with the IPC operations 1517 and placethose messages in the background queue 1526 of the host process 1520 forprocessing.

In one embodiment, the priority of a sending process can be donated to areceiving process. The sending process can send a priority donationvoucher to the receiving process. If the receiving process is operatingat a lower priority than the sending process, the priority donationvoucher allows the receiving process to operate at the higher priorityassociated with the sending process, to prevent the higher prioritysending process from being delayed by a lower priority receivingprocess. Priority donation may be particularly important when one ormore threads of the receiving process are operating a low priority. Forexample, if the content process 1510 is operating at a high (e.g.,interactive) priority the higher priority will be donated to the hostprocess 1520. Even through the messages for the IPC operations 1517 areplaced in the background queue 1526 of the host process, the messagescan be processed at the priority donated from the content process 1510.The host process 1520 can retain the high priority until a reply issent.

Based on the received message, a service thread of the host process 1520can trigger an event that will be picked up during a cycle of the runloop (RunLoop.run( ) 1525) of the main queue 1521 of the host process1520. The main queue 1521 can handle the event by calling theimplementation of operation A (self.operationA 1524). If theimplementation of operation A requires information from the contentprocess that can be provided, for example, via remote proxy call tooperation B of the content process (content.operationB( ) 1523), IPCoperations 1527 to enable the remote call can be placed in to thebackground queue 1526 of the host process 1520. The IPC operations 1527can also be sent from the main queue 1521 if the host process 1521 isoperating at interactive priority, allowing the use of the prioritydonation system described above. Messages to enable such operations canbe transmitted by a service thread of the host process 1520 to thecontent process 1510. Those messages can be received and a reentrantinvocation (RunLoop.run(1513) of the run loop can be performed to calloperation B (operation B( ) 1512). General UI event processing is notperformed during this sequence, as the run loops of the main queues1511, 1521 are transitioned to a special remote-invocation mode in whichonly events associated with remote function invocations are processed.The special run loop mode enables operations associated with remoteproxy invocations to be performed asynchronously, in a non-blockingmanner, while ensuring that the stacking and unwinding of thoseoperations is performed quickly enough to maintain an interactive levelof performance. Once the nested remote calls unwind, the run loops canbe returned to their previous modes of operation. For example,RunLoop.run( ) 1522 of the host process can be run in the default runloop mode.

In one embodiment, run-loop reentrancy for remote function invocationsis enabled via atomically updated generation counts to status variablesassociated with the processing of operations within the main queues1511, 1521. Variables associated with a first round IPC calls are givena generation count associated with that round of call. When a reentrantcall is made, the previous set of variables, particularly, dynamicallyallocated variables that are not stored on the stack, are preserved anda generation count for those variables is atomically updated. As nestedcalls are unwound, the generation counts are decremented. Once thegeneration count reaches zero, or another pre-determined value, the runloop and IPC system can determine that a nested call stack has beenresolved and normal operation can resume.

In one embodiment, processes 1510, 1520 are configured to relay stateassociated with any spurious wakeups that are received while processinginteractive multi-process activities. For example, while waiting for thereturn of a remotely invocated proxy function, a process can be placedinto a sleep state while other operations are performed. In oneembodiment, during a set of nested calls, the thread and processmanagement logic attempts to wake only the most recently waiting thread.However, it cannot always be ensured that threads are awoken in thecorrect order. It may be possible for a process or thread to be awokenspuriously, such that the process wakes and receives an event thatshould be handled by another process. To address this issue, theprocesses 1510, 1520 can be configured to store any events receivedduring spurious wakes and relay those events to other waiters. In oneembodiment, the spurious wakeups involve a call made earlier, on anearlier stack frame, on the same thread. When the main thread for aprocess is woken, the kernel and other components consider the wakeup tohave been delivered. However, the thread may still be waiting on areplay for a call in a later stack frame. In such embodiment ageneration count is used to ensure that, as the call stack unwinds, anyspurious wakeups that were received can be properly associated with therun loop invocation to which the wakeup belongs. Any number ofoutstanding calls can be waiting for results and the results will beassigned to the proper call, without regard to the order in which theresults are received. Without spurious wakeup handling, processing mayfail due to a mismatch between sleeping threads and call responses, asthe kernel may assume that a waiting thread has already been woken, eventhough the thread did not actually receive its response within theproper stack frame.

As shown in FIG. 15B, the content process 1510 and host process 1520 canengage in a series of nested remote function calls using an IPCcommunication channel. A remote proxy for a first operation (Host.OpA1514) can be called at the content process 1510, which triggers a remoteinvocation 1541 of the implementation of the operation (self.OpA 1524).Instead of conveying the remote invocation 1541 via blocking (e.g.,synchronous) IPC operations, the remote invocation 1541 is conveyedasynchronously to the host process 1520. Execution of the implementationof the first operation can include a call to a remote proxy of a secondoperation (Content.OpB 1523), which causes an asynchronous remoteinvocation 1542 of the second operation (self.OpB 1512) at the contentprocess 1510. IPC messages for remote invocation 1542 can be stored inbackground queue 1516 of the content process 1510. The run loop of thecontent process 1510 can be configured to a special remote invocationmode. A remote invocation event can be triggered to cause the run loopof the content process 1510 to pick up the IPC messages associated withremote invocation 1542.

In one embodiment, nested calls can continue with a remote invocation1543 of a proxy third operation (Host.OpC 1532) from within theimplementation of the second operation. The implementation of the thirdoperation (self.OpC 1542) within the host process 1520 can execute andreturn 1544 data via the remote proxy of the third operation (Host.OpC1532). The call stack can unwind via a return 1545 from the secondoperation and return 1546 from the first operation. The generation countis atomically updated during each cycle of nested calls. When the callstack unwinds, the generation count is atomically decremented.

FIG. 16A is a flow diagram of a method 1600 of relaying messagesassociated with nested remote function invocations within amulti-process application, according to an embodiment. In oneembodiment, method 1600 is performed by software logic executing on oneor more processors of a data processing system described herein. Thesoftware logic includes logic of the content process 1510 and hostprocess 1520 of FIG. 15A. In one embodiment, method 1600 includesoperation 1601, which receives a remote invocation of a first functionprovided by a first process of a multi-process application. The functioncan be invoked by a second process of the multi-process application. Forexample, the content process 1510 of a multi-process application cancall into a function provided by the host process 1520.

To relay the remote invocation between processes, method 1600 canperform operation 1602, which stores an IPC message associated with theremote invocation of the first function in a background queue of thefirst process. In one embodiment the IPC message can be stored in thebackground queue of the first process after being transmitted from abackground queue of the second process. Method 1600 additionallyincludes operation 1603, which configures the run loop of the firstprocess to accept only remote invocation events, which are specialevents used to pass remote invocation messages. The events for which therun loop will respond can be configured by changing the mode in whichthe run loop is executed. The mode of the run loop is the collection ofinput sources and timers to be monitored on behalf of the run loop. Whenevents that correspond with the configured mode of a run loop occur, therun loop is notified by the system.

Method 1600 additionally includes operation 1604, which triggers aremote invocation event at the first process to relay the IPC messagefrom the background queue. The run loop of the first process can pick upthe remote invocation event and retrieve data associated with the IPCmessage. The first process can then respond to the IPC event viaoperation 1605, which calls the first function. The first function canthen be executed by the first process using execution state specified bythe second process.

As shown in FIG. 16B, completion of the first function call at the firstprocess may require a remote invocation of a second function provided bythe second process. Method 1600 can continue to operation 1611, whichreceives a remote invocation of a second function provided by the secondprocess from within the call to the first function. Method 1600 can thenperform operation 1612, which stores an IPC message associated with theremote invocation of the second function in a background queue of thesecond process. The nested remote invocation is sent asynchronously,even though the function call is logically a synchronous operation.Method 1600 additionally includes operation 1613 to configure the runloop of the second process to accept only IPC events. Method 1600additionally includes operation 1614, which triggers an IPC event atsecond process to relay IPC message associated with the remoteinvocation from the background queue. Method 1600 continues to operation1615, which responds to the IPC event at second process by calling theimplementation of the second function.

As shown in FIG. 16C, method 1600 continues at operation 1621 in whichoperations at the second function of the section process are completedand the implementation of the second function returns. Method 1600 canthen proceed to operation 1622 to store an IPC message associated withthe return from the second function in the background queue of the firstprocess. Method 1600 then proceeds to operation 1623, which triggers aremote invocation event at first process to pass the return from thesecond function to the first function. The operations of the firstfunction can complete at operation 1624 and the first function canreturn. Once the first function returns and the nest of calls isdetermined to be unwound, method 1600 can proceed to operation 1626 toreturn the run loops to the previous modes of operation for theprocesses.

FIG. 17A-17B illustrate a system and method on a host platform to enableexecution of a hosted mobile application, according to embodimentsdescribed herein. FIG. 17A illustrates a system 1740 of frameworks on ahost platform that enable execution of a hosted mobile application. FIG.17B illustrates a method 1760 of loading multi-platform libraries on thehost platform. The system 1740 of frameworks can reside on a computingdevice associated with a host platform as described herein. Method 1760is a computer implemented method performed by one or more processorsdescribed herein.

As shown in FIG. 17A, in one embodiment, hosted mobile applications 1744can be based on program code that can alternately be compiled to executeon a mobile platform or as a hosted application that can execute withinthe host operating environment of system 1740. When compiled for hostedexecution, hosted mobile applications 1744 can execute alongside hostplatform applications 1741 that are designed and compiled for executionon the host operating environment. In one embodiment, some of the mobilefunctionality can be enabled by integrating some of the support providedto simulated mobile applications into the libraries and frameworks thatare available to all applications executing on the host operatingenvironment of system 1740.

In one embodiment the host operating environment of system 1740 caninclude versions of libraries and frameworks from a host framework stackthat are extended to include functionality used by host platformapplications 1741 and hosted mobile applications 1744. Such librariesand frameworks can be described as zippered. Some libraries andframeworks of the host framework stack 1710 cannot be combined withcorresponding libraries that perform similar functionality due to APIincompatibilities or other incompatibilities between the libraries.Accordingly, multiple instances of those libraries (e.g., unzipperedtwins) can reside in the host operating environment of system 1740, withone instance provided for use by host platform applications 1741 and asecond instance provided for use by hosted mobile applications 1744. Thespecific details of which libraries fall into which category can varyacross embodiments. In general, embodiments described herein providesystems and methods by which a build environment, linker, and loader forthe host operating environment can be configured to support the variousclassifications of libraries and frameworks that would reside in a hostoperating environment that supports multi-OS applications.

Exemplary zippered libraries and frameworks include an audio/graphicsframework 1750, a foundation framework 1753, security framework 1754,and system library 1755 (e.g., lib System). The zippered libraries andframeworks provide a superset of functionality accessed by host platformapplications 1741 and hosted mobile application 1744. Exemplaryunzippered twin libraries and frameworks include high-level librariesand frameworks 1742, 1746 (e.g., web engines, 3D APIs) that providesimilar functionality, but have incompatibilities and preventintegration. Additional unzippered libraries and frameworks include thehost UI framework 1743 and the mobile UI framework 1747, which aredifferent frameworks that each provide similar functionality.

The illustrated libraries and frameworks of host operating environmentof system 1740 can be dynamic libraries with multiple versions, withsome versions that can be compiled for a mobile platform, other versionsthat can be compiled for a host (e.g., desktop/laptop) platform, andstill other versions that can be compiled to provide functionality tomobile applications that are compiled for execution on the hostoperating environment.

As shown in FIG. 17B, method 1760 includes to perform an operation 1762to load at least a first process and a second process of amulti-platform application for execution. The multi-platform applicationcan execute as two or more processes that include at least a firstprocess and a second process, where the first process includes programlogic developed for a first platform and a second process includesprogram logic developed for a second platform. The first platform canbe, for example, a mobile platform, while the second platform can be ahost platform configured to execute hosted mobile applications. In someembodiments, three or more processes can be associated with themulti-platform application, for example, to enable hardware featuresthat may be present on some instances of a host platform. In oneembodiment, a third process associated with the host platform can bepresent to enable a touch bar feature, such as the touch bar 920 of FIG.9B, or another hardware feature of the host platform.

In one embodiment, method 1760 additionally includes operation 1764 toparse one or more object files of the multi-platform application todetermine a set of symbols to resolve. In operation 1764, a first symbolin the set of symbols is associated with the first platform, while thesecond symbol in the set of symbols is associated with the secondplatform. The compiled program code of the various processes of themulti-platform application can reside in a single executable object fileor a package including multiple object files. The parsing of operation1764, in one embodiment, can occur during the load of the multi-platformapplication.

In a further embodiment, method 1760 additionally includes operation1766, to resolve references to the first symbol and the second symbolvia a multi-platform library. The multi-platform library can be storedin memory of the host platform. The multi-platform library can be loadedinto the memory prior to execution of the multi-platform application,for example, in association with the loading of another application. Themulti-platform library can also be loaded into the memory during theload of the multi-platform application, for example, if the library wasnot previously loaded into memory.

After resolving the references to the first symbol and the secondsymbol, method 1760 can perform operation 1768 to bind the first symboland the second symbol to memory associated with the multi-platformlibrary, which includes the data (e.g., program code, objects, etc.) towhich the symbols were resolved. The bind within operation 1768 linksthe multi-platform library with the multi-platform application. In oneembodiment, the multi-platform library can also be linked to programcode associated with a native application of the host platform.

Embodiments described herein include one or more application programminginterfaces (APIs) in an environment in which calling program codeinteracts with other program code that is called through one or moreprogramming interfaces. Various function calls, messages, or other typesof invocations, which further may include various kinds of parameters,can be transferred via the APIs between the calling program and the codebeing called. In addition, an API may provide the calling program codethe ability to use data types or classes defined in the API andimplemented in the called program code.

An API allows a developer of an API-calling component (which may be athird-party developer) to leverage specified features provided by anAPI-implementing component. There may be one API-calling component orthere may be more than one such component. An API can be a source codeinterface that a computer system or program library provides to supportrequests for services from an application. An operating system (OS) canhave multiple APIs to allow applications running on the OS to call oneor more of those APIs, and a service (such as a program library) canhave multiple APIs to allow an application that uses the service to callone or more of those APIs. An API can be specified in terms of aprogramming language that can be interpreted or compiled when anapplication is built.

In some embodiments, the API-implementing component may provide morethan one API, each providing a different view of or with differentaspects that access different aspects of the functionality implementedby the API-implementing component. For example, one API of anAPI-implementing component can provide a first set of functions and canbe exposed to third party developers, and another API of theAPI-implementing component can be hidden (not exposed) and provide asubset of the first set of functions and also provide another set offunctions, such as testing or debugging functions which are not in thefirst set of functions. In other embodiments, the API-implementingcomponent may itself call one or more other components via an underlyingAPI and thus be both an API-calling component and an API-implementingcomponent.

An API defines the language and parameters that API-calling componentsuse when accessing and using specified features of the API-implementingcomponent. For example, an API-calling component accesses the specifiedfeatures of the API-implementing component through one or more API callsor invocations (embodied for example by function or method calls)exposed by the API and passes data and control information usingparameters via the API calls or invocations. The API-implementingcomponent may return a value through the API in response to an API callfrom an API-calling component. While the API defines the syntax andresult of an API call (e.g., how to invoke the API call and what the APIcall does), the API may not reveal how the API call accomplishes thefunction specified by the API call. Various API calls are transferredvia the one or more application programming interfaces between thecalling (API-calling component) and an API-implementing component.Transferring the API calls may include issuing, initiating, invoking,calling, receiving, returning, or responding to the function calls ormessages; in other words, transferring can describe actions by either ofthe API-calling component or the API-implementing component. Thefunction calls or other invocations of the API may send or receive oneor more parameters through a parameter list or other structure. Aparameter can be a constant, key, data structure, object, object class,variable, data type, pointer, array, list or a pointer to a function ormethod or another way to reference a data or other item to be passed viathe API.

Furthermore, data types or classes may be provided by the API andimplemented by the API-implementing component. Thus, the API-callingcomponent may declare variables, use pointers to, use or instantiateconstant values of such types or classes by using definitions providedin the API.

Generally, an API can be used to access a service or data provided bythe API-implementing component or to initiate performance of anoperation or computation provided by the API-implementing component. Byway of example, the API-implementing component and the API-callingcomponent may each be any one of an operating system, a library, adevice driver, an API, an application program, or other module (itshould be understood that the API-implementing component and theAPI-calling component may be the same or different type of module fromeach other). API-implementing components may in some cases be embodiedat least in part in firmware, microcode, or other hardware logic. Insome embodiments, an API may allow a client program to use the servicesprovided by a Software Development Kit (SDK) library. In otherembodiments, an application or other client program may use an APIprovided by an Application Framework. In these embodiments, theapplication or client program may incorporate calls to functions ormethods provided by the SDK and provided by the API or use data types orobjects defined in the SDK and provided by the API. An ApplicationFramework may in these embodiments provide a main event loop for aprogram that responds to various events defined by the Framework. TheAPI allows the application to specify the events and the responses tothe events using the Application Framework. In some implementations, anAPI call can report to an application the capabilities or state of ahardware device, including those related to aspects such as inputcapabilities and state, output capabilities and state, processingcapability, power state, storage capacity and state, communicationscapability, etc., and the API may be implemented in part by firmware,microcode, or other low-level logic that executes in part on thehardware component.

The API-calling component may be a local component (i.e., on the samedata processing system as the API-implementing component) or a remotecomponent (i.e., on a different data processing system from theAPI-implementing component) that communicates with the API-implementingcomponent through the API over a network. It should be understood thatan API-implementing component may also act as an API-calling component(i.e., it may make API calls to an API exposed by a differentAPI-implementing component) and an API-calling component may also act asan API-implementing component by implementing an API that is exposed toa different API-calling component.

The API may allow multiple API-calling components written in differentprogramming languages to communicate with the API-implementing component(thus the API may include features for translating calls and returnsbetween the API-implementing component and the API-calling component);however, the API may be implemented in terms of a specific programminglanguage. An API-calling component can, in one embedment, call APIs fromdifferent providers such as a set of APIs from an OS provider andanother set of APIs from a plug-in provider and another set of APIs fromanother provider (e.g., the provider of a software library) or creatorof the another set of APIs.

FIG. 18 is a block diagram illustrating an exemplary API architecture,which may be used in some embodiments of the invention. As shown in FIG.18, the API architecture 1800 includes the API-implementing component1810 (e.g., an operating system, a library, a device driver, an API, anapplication program, software, or other module) that implements the API1820. The API 1820 specifies one or more functions, methods, classes,objects, protocols, data structures, formats and/or other features ofthe API-implementing component that may be used by the API-callingcomponent 1830. The API 1820 can specify at least one calling conventionthat specifies how a function in the API-implementing component receivesparameters from the API-calling component and how the function returns aresult to the API-calling component. The API-calling component 1830(e.g., an operating system, a library, a device driver, an API, anapplication program, software or other module), makes API calls throughthe API 1820 to access and use the features of the API-implementingcomponent 1810 that are specified by the API 1820. The API-implementingcomponent 1810 may return a value through the API 1820 to theAPI-calling component 1830 in response to an API call.

It will be appreciated that the API-implementing component 1810 mayinclude additional functions, methods, classes, data structures, and/orother features that are not specified through the API 1820 and are notavailable to the API-calling component 1830. It should be understoodthat the API-calling component 1830 may be on the same system as theAPI-implementing component 1810 or may be located remotely and accessesthe API-implementing component 1810 using the API 1820 over a network.While FIG. 18 illustrates a single API-calling component 1830interacting with the API 1820, it should be understood that otherAPI-calling components, which may be written in different languages (orthe same language) than the API-calling component 1830, may use the API1820.

The API-implementing component 1810, the API 1820, and the API-callingcomponent 1830 may be stored in a machine-readable medium, whichincludes any mechanism for storing information in a form readable by amachine (e.g., a computer or other data processing system). For example,a machine-readable medium includes magnetic disks, optical disks,random-access memory; read only memory, flash memory devices, etc.

FIG. 19A-19B are block diagrams of exemplary API software stacks 1900,1910, according to embodiments. FIG. 19A shows an exemplary API softwarestack 1900 in which processes 1902 can make calls to Service A orService B using Service API and to Operating System 1904 using an OSAPI. Additionally, Service A and Service B can make calls to OperatingSystem 1904 using several OS APIs. The processes 1902, in oneembodiment, are multiple processes operating in concert to enable amulti-process application as described herein.

FIG. 19B shows an exemplary API software stack 1910 including Process 1(1902A), Process 2 (1902B), Service 1 (1905), Service 2 (1906), andOperating System 1904. As illustrated, Service 2 has two APIs, one ofwhich (Service 2 API 1) receives calls from and returns values toApplication 1 and the other (Service 2 API 2) receives calls from andreturns values to Application 2. Service 1 (which can be, for example, asoftware library) makes calls to and receives returned values from OSAPI 1, and Service 2 (which can be, for example, a software library)makes calls to and receives returned values from both OS API 1 and OSAPI 2. Application 2 makes calls to and receives returned values from OSAPI 2. Service 1 can be, for example, a mobile UI framework as describedherein, while Service 2 can be a host UI framework as described herein.Service 1 API and Service 2 API can be APIs implemented via a variant ofthe integrated IPC runtime interface described herein, which can enableinteroperability between Process 1 and Process 2.

FIG. 20 is a block diagram of a device architecture 2000 for a mobile orembedded device, according to an embodiment. The device architecture2000 includes a memory interface 2002, a processing system 2004including one or more data processors, image processors and/or graphicsprocessing units, and a peripherals interface 2006. The variouscomponents can be coupled by one or more communication buses or signallines. The various components can be separate logical components ordevices or can be integrated in one or more integrated circuits, such asin a system on a chip integrated circuit.

The memory interface 2002 can be coupled to memory 2050, which caninclude high-speed random-access memory such as static random-accessmemory (SRAM) or dynamic random-access memory (DRAM) and/or non-volatilememory, such as but not limited to flash memory (e.g., NAND flash, NORflash, etc.).

Sensors, devices, and subsystems can be coupled to the peripheralsinterface 2006 to facilitate multiple functionalities. For example, amotion sensor 2010, a light sensor 2012, and a proximity sensor 2014 canbe coupled to the peripherals interface 2006 to facilitate the mobiledevice functionality. One or more biometric sensor(s) 2015 may also bepresent, such as a fingerprint scanner for fingerprint recognition or animage sensor for facial recognition. Other sensors 2016 can also beconnected to the peripherals interface 2006, such as a positioningsystem (e.g., GPS receiver), a temperature sensor, or other sensingdevice, to facilitate related functionalities. A camera subsystem 2020and an optical sensor 2022, e.g., a charged coupled device (CCD) or acomplementary metal-oxide semiconductor (CMOS) optical sensor, can beutilized to facilitate camera functions, such as recording photographsand video clips.

Communication functions can be facilitated through one or more wirelesscommunication subsystems 2024, which can include radio frequencyreceivers and transmitters and/or optical (e.g., infrared) receivers andtransmitters. The specific design and implementation of the wirelesscommunication subsystems 2024 can depend on the communication network(s)over which a mobile device is intended to operate. For example, a mobiledevice including the illustrated device architecture 2000 can includewireless communication subsystems 2024 designed to operate over a GSMnetwork, a CDMA network, an LTE network, a Wi-Fi network, a Bluetoothnetwork, or any other wireless network. In particular, the wirelesscommunication subsystems 2024 can provide a communications mechanismover which a media playback application can retrieve resources from aremote media server or scheduled events from a remote calendar or eventserver.

An audio subsystem 2026 can be coupled to a speaker 2028 and amicrophone 2030 to facilitate voice-enabled functions, such as voicerecognition, voice replication, digital recording, and telephonyfunctions. In smart media devices described herein, the audio subsystem2026 can be a high-quality audio system including support for virtualsurround sound.

The I/O subsystem 2040 can include a touch screen controller 2042 and/orother input controller(s) 2045. For computing devices including adisplay device, the touch screen controller 2042 can be coupled to atouch sensitive display system 2046 (e.g., touch-screen). The touchsensitive display system 2046 and touch screen controller 2042 can, forexample, detect contact and movement and/or pressure using any of aplurality of touch and pressure sensing technologies, including but notlimited to capacitive, resistive, infrared, and surface acoustic wavetechnologies, as well as other proximity sensor arrays or other elementsfor determining one or more points of contact with a touch sensitivedisplay system 2046. Display output for the touch sensitive displaysystem 2046 can be generated by a display controller 2043. In oneembodiment, the display controller 2043 can provide frame data to thetouch sensitive display system 2046 at a variable frame rate.

In one embodiment, a sensor controller 2044 is included to monitor,control, and/or processes data received from one or more of the motionsensor 2010, light sensor 2012, proximity sensor 2014, or other sensors2016. The sensor controller 2044 can include logic to interpret sensordata to determine the occurrence of one of more motion events oractivities by analysis of the sensor data from the sensors.

In one embodiment, the I/O subsystem 2040 includes other inputcontroller(s) 2045 that can be coupled to other input/control devices2048, such as one or more buttons, rocker switches, thumb-wheel,infrared port, USB port, and/or a pointer device such as a stylus, orcontrol devices such as an up/down button for volume control of thespeaker 2028 and/or the microphone 2030.

In one embodiment, the memory 2050 coupled to the memory interface 2002can store instructions for an operating system 2052, including portableoperating system interface (POSIX) compliant and non-compliant operatingsystem or an embedded operating system. The operating system 2052 mayinclude instructions for handling basic system services and forperforming hardware dependent tasks. In some implementations, theoperating system 2052 can be a kernel.

The memory 2050 can also store communication instructions 2054 tofacilitate communicating with one or more additional devices, one ormore computers and/or one or more servers, for example, to retrieve webresources from remote web servers. The memory 2050 can also include userinterface instructions 2056, including graphical user interfaceinstructions to facilitate graphic user interface processing.

Additionally, the memory 2050 can store sensor processing instructions2058 to facilitate sensor-related processing and functions; telephonyinstructions 2060 to facilitate telephone-related processes andfunctions; messaging instructions 2062 to facilitateelectronic-messaging related processes and functions; web browserinstructions 2064 to facilitate web browsing-related processes andfunctions; media processing instructions 2066 to facilitate mediaprocessing-related processes and functions; location servicesinstructions including GPS and/or navigation instructions 2068 and Wi-Fibased location instructions to facilitate location based functionality;camera instructions 2070 to facilitate camera-related processes andfunctions; and/or other software instructions 2072 to facilitate otherprocesses and functions, e.g., security processes and functions, andprocesses and functions related to the systems. The memory 2050 may alsostore other software instructions such as web video instructions tofacilitate web video-related processes and functions; and/or webshopping instructions to facilitate web shopping-related processes andfunctions. In some implementations, the media processing instructions2066 are divided into audio processing instructions and video processinginstructions to facilitate audio processing-related processes andfunctions and video processing-related processes and functions,respectively. A mobile equipment identifier, such as an InternationalMobile Equipment Identity (IMEI) 2074 or a similar hardware identifiercan also be stored in memory 2050.

Each of the above identified instructions and applications cancorrespond to a set of instructions for performing one or more functionsdescribed above. These instructions need not be implemented as separatesoftware programs, procedures, or modules. The memory 2050 can includeadditional instructions or fewer instructions. Furthermore, variousfunctions may be implemented in hardware and/or in software, includingin one or more signal processing and/or application specific integratedcircuits.

FIG. 21 is a block diagram of a computing system 2100, according to anembodiment. The illustrated computing system 2100 is intended torepresent a range of computing systems (either wired or wireless)including, for example, desktop computer systems, laptop computersystems, tablet computer systems, cellular telephones, personal digitalassistants (PDAs) including cellular-enabled PDAs, set top boxes,entertainment systems or other consumer electronic devices, smartappliance devices, or one or more implementations of a smart mediaplayback device. Alternative computing systems may include more, fewerand/or different components. The computing system 2100 can be used toprovide the computing device and/or a server device to which thecomputing device may connect.

The computing system 2100 includes bus 2135 or other communicationdevice to communicate information, and processor(s) 2110 coupled to bus2135 that may process information. While the computing system 2100 isillustrated with a single processor, the computing system 2100 mayinclude multiple processors and/or co-processors. The computing system2100 further may include 2120, such as a random access memory (RAM) orother dynamic storage device coupled to the bus 2135. The memory 2120may store information and instructions that may be executed byprocessor(s) 2110. The memory 2120 can be used as main system memory andcan be used to store temporary variables or other intermediateinformation during execution of instructions by the processor(s) 2110.

The computing system 2100 may also include read only memory (ROM) 2130and/or another data storage device 2140 coupled to the bus 2135 that maystore information and instructions for the processor(s) 2110. The datastorage device 2140 can be or include a variety of storage devices, suchas a flash memory device, a magnetic disk, or an optical disc and may becoupled to computing system 2100 via the bus 2135 or via a remoteperipheral interface.

The computing system 2100 may also be coupled, via the bus 2135, to adisplay device 2150 to display information to a user. The computingsystem 2100 can also include an alphanumeric input device 2160,including alphanumeric and other keys, which may be coupled to bus 2135to communicate information and command selections to processor(s) 2110.Another type of user input device includes a cursor control 2170 device,such as a touchpad, a mouse, a trackball, or cursor direction keys tocommunicate direction information and command selections to processor(s)2110 and to control cursor movement on the display device 2150. Thecomputing system 2100 may also receive user input from a remote devicethat is communicatively coupled via one or more network interface(s)2180.

The computing system 2100 further may include one or more networkinterface(s) 2180 to provide access to a network, such as a local areanetwork. The network interface(s) 2180 may include, for example, awireless network interface having antenna 2185, which may represent oneor more antenna(e). The computing system 2100 can include multiplewireless network interfaces such as a combination of Wi-Fi, Bluetooth®,near field communication (NFC), and/or cellular telephony interfaces.The network interface(s) 2180 may also include, for example, a wirednetwork interface to communicate with remote devices via network cable2187, which may be, for example, an Ethernet cable, a coaxial cable, afiber optic cable, a serial cable, or a parallel cable.

In one embodiment, the network interface(s) 2180 may provide access to alocal area network, for example, by conforming to IEEE 802.11 standards,and/or the wireless network interface may provide access to a personalarea network, for example, by conforming to Bluetooth standards. Otherwireless network interfaces and/or protocols can also be supported. Inaddition to, or instead of, communication via wireless LAN standards,network interface(s) 2180 may provide wireless communications using, forexample, Time Division, Multiple Access (TDMA) protocols, Global Systemfor Mobile Communications (GSM) protocols, Code Division, MultipleAccess (CDMA) protocols, Long Term Evolution (LTE) protocols, and/or anyother type of wireless communications protocol.

The computing system 2100 can further include one or more energy sources2105 and one or more energy measurement systems 2145. Energy sources2105 can include an AC/DC adapter coupled to an external power source,one or more batteries, one or more charge storage devices, a USBcharger, or other energy source. Energy measurement systems include atleast one voltage or amperage measuring device that can measure energyconsumed by the computing system 2100 during a predetermined period oftime. Additionally, one or more energy measurement systems can beincluded that measure, e.g., energy consumed by a display device,cooling subsystem, Wi-Fi subsystem, or other frequently used orhigh-energy consumption subsystem.

The following clauses and/or examples pertain to specific embodiments orexamples thereof. Specifics in the examples may be used anywhere in oneor more embodiments. The various features of the different embodimentsor examples may be variously combined with some features included andothers excluded to suit a variety of different applications. Examplesmay include subject matter such as a method, means for performing actsof the method, at least one machine-readable medium includinginstructions that, when performed by a machine cause the machine toperform acts of the method, or of an apparatus or system according toembodiments and examples described herein. Various components can be ameans for performing the operations or functions described.

Embodiments described herein provide for a multi-process model tosupport compiling applications for multiple platforms. In oneembodiment, applications designed for execution on a mobile platform canbe ported to and/or compiled for execution on a desktop/laptop platformwithout requiring modification of the core program code of the mobileapplication. The mobile application is executed using a multi-process(e.g., two or more process) model in which the core mobile applicationprogram generates content that is displayed by a host process. The hostprocess enables automatic translation of program calls to generatemobile user interface elements into program calls that generate userinterface elements of the host platform. The translation can beperformed using a multi-process (e.g., two or more process) model inwhich the core application program generates content that is displayedby a host process.

One embodiment provides a method of displaying user interface elementsof an application via a multi-process model. The method compriseslaunching, on a second platform, a first process linked with a firstgraphical interface framework of a first platform and launching, on thesecond platform, a second process linked with a second graphicalinterface framework of the second platform. The method additionallyincludes establishing an inter-process communication link between thefirst process and the second process, instantiating, by the firstprocess, a first graphical interface element using the first graphicalinterface framework, instantiating, by the second process, a secondgraphical interface element using the second graphical interfaceframework, and using the inter-process communication link, displayingthe first graphical interface element within the second graphicalinterface element.

One embodiment provides for a non-transitory machine readable mediumstoring instructions which, when executed by one or more processors on ahost computing platform, cause the one or more processors to performoperations comprising the method of displaying user interface elementsof an application via a multi-process model described herein. In oneembodiment the instructions stored on the non-transitorymachine-readable medium can be executed by a data processing systemdescribed herein.

One embodiment provides for a data processing system comprising a memoryto store instructions for a multi-platform library and a multi-platformapplication and one or more processors to execute instructions inmemory. The multi-platform application can be configured to execute asat least a first process and a second process. The instructions inmemory can cause the one or more processors to load the multi-platformapplication for execution, wherein the first process of themulti-platform application includes program logic developed for a firstplatform and the second process of the multi-platform applicationincludes program logic developed for a second platform. During the loadof the multi-platform application, the one or more processors can parsean object file of the multi-platform application to determine a set ofsymbols to resolve. A first symbol in the set of symbols can beassociated with the first device platform. The second symbol in the setof symbols can be associated with the second device platform. The one ormore processors can be further configured to resolve the first symboland the second symbol via the multi-platform library and bind the firstsymbol and second symbol to memory associated with multi-platformlibrary.

One embodiment provides for a non-transitory machine readable mediumstoring instructions which, when executed by one or more processors on acomputing device, causes the computing device to perform operationscomprising establishing an inter-process communication session from aclient process to a service process on the computing device, accessing aprotocol interface from the client process that enables access to aservice provided by the service process, wherein the protocol interfaceis associated with a remote proxy of an implementation of the service,programmatically creating a remote instance of the implementation of theservice via the remote proxy, and programmatically invokingfunctionality provided by the service process at the client process.

One embodiment provides for a data processing system comprising a memoryto store instructions and one or more processors to execute theinstructions. The instructions cause the one or more processors toestablish an inter-process communication session from a client processto a service process on a computing device, access a protocol interfacefrom the client process that enables access to a service provided by theservice process, wherein the protocol interface is associated with aremote proxy of an implementation of the service, programmaticallycreate a remote instance of the implementation of the service via theremote proxy, and programmatically invoke functionality provided by theservice process at the client process.

One embodiment provides for a method implemented on a computing device.The method comprises establishing an inter-process communication sessionfrom a client process to a service process on the computing device,accessing a protocol interface from the client process that enablesaccess to a service provided by the service process, wherein theprotocol interface is associated with a remote proxy of animplementation of the service, programmatically creating a remoteinstance of the implementation of the service via the remote proxy, andprogrammatically invoking functionality provided by the service processat the client process.

One embodiment provides for a non-transitory machine readable mediumstoring instructions which, when executed by one or more processors on acomputing device, causes the computing device to perform operationscomprising launching multi-process application on the computing device,where the multi-process application includes a content process linkedwith a first graphical interface framework of a first platform and ahost process linked with a second graphical interface framework of asecond platform. The instructions can additionally cause the computingdevice to programmatically invoke functionality provided by the hostprocess from the content process, where programmatically invoking thefunctionality causes execution of a program code subroutine at the hostprocess. The program code subroutine at the host process can cause thedisplay of a user interface element via the second graphical interfaceframework, where the user interface element is generated at least inpart using the first graphical interface framework. While waiting for areply from the program code subroutine at the host process, thecomputing device can receive a remote invocation of functionalityprovided by the content process from the host process, reentrantlyexecute a program code subroutine of the content process in response tothe remote invocation from the host process, return a result ofexecution of the program decode subroutine of the content process to thehost process, and display the user interface element on a display deviceof the computing device. A characteristic of the user interface elementcan depend on a result of the execution of the program code subroutineof the content process.

One embodiment provides for a data processing system comprising a memoryto store instructions and one or more processors to execute theinstructions. The instructions cause the one or more processors tolaunch multi-process application on a computing device, where themulti-process application includes a content process linked with a firstgraphical interface framework of a first platform and a host processlinked with a second graphical interface framework of a second platform.The one or more processors can additionally programmatically invokefunctionality provided by the host process from the content process,wherein programmatic invocation of the functionality causes execution ofa program code subroutine at the host process, the program codesubroutine at the host process to display a user interface element viathe second graphical interface framework, the user interface elementgenerated at least in part using the first graphical interfaceframework. During a wait for a reply from the program code subroutine atthe host process, the one or more processors can receive a remoteinvocation of functionality provided by the content process from thehost process, reentrantly execute a program code subroutine of thecontent process in response to the remote invocation from the hostprocess, return a result of execution of the program code subroutine ofthe content process to the host process, and display the user interfaceelement on a display device of the computing device. A characteristic ofthe user interface element can depend on a result of the execution ofthe program code subroutine of the content process.

One embodiment provides for a computer implemented method that includeslaunching multi-process application on the computing device, where themulti-process application includes a content process linked with a firstgraphical interface framework of a first platform and a host processlinked with a second graphical interface framework of a second platform.The method can additionally include programmatically invokingfunctionality provided by the host process from the content process,where programmatically invoking the functionality causes execution of aprogram code subroutine at the host process. The program code subroutineat the host process can cause the display of a user interface elementvia the second graphical interface framework, where the user interfaceelement is generated at least in part using the first graphicalinterface framework. While waiting for a reply from the program codesubroutine at the host process, the computer on which the method isimplemented can receive a remote invocation of functionality provided bythe content process from the host process, reentrantly execute a programcode subroutine of the content process in response to the remoteinvocation from the host process, return a result of execution of theprogram decode subroutine of the content process to the host process,and display the user interface element on a display device of thecomputing device. A characteristic of the user interface element candepend on a result of the execution of the program code subroutine ofthe content process.

The above examples do not include an exhaustive list of all embodimentsenabled by this disclosure. All systems and methods can be practicedfrom all suitable combinations of the various aspects and embodimentsdescribed herein. For example, a further embodiment provides for anelectronic device that is configurable to implement methods oroperations described herein. Thus, those skilled in the art willappreciate from the foregoing description that the broad techniques ofthe embodiments can be implemented in a variety of forms. Therefore,while the embodiments have been described in connection with particularexamples thereof, the true scope of the embodiments should not be solimited since other modifications will become apparent to the skilledpractitioner upon a study of the drawings, specification, and followingclaims.

What is claimed is:
 1. A non-transitory machine readable medium storinginstructions which, when executed by one or more processors on a hostcomputing platform, cause the one or more processors to performoperations comprising: establishing an inter-process communicationsession from a process of a client application to a service process onthe host computing platform; accessing a protocol interface from theprocess of the client application that enables access to a serviceprovided by the service process, wherein the protocol interface isassociated with a proxy of an implementation of the service;programmatically creating an instance of the implementation of theservice via the proxy; and invoking functionality provided by theservice process at the process of the client application via theinstance of the implementation of the service.
 2. The non-transitorymachine readable medium as in claim 1, wherein the client application isa mobile application configured to make use of a mobile graphicalinterface protocol and the service process enables display of graphicalelements associated with the mobile application on a graphical interfaceof the host computing platform, wherein the mobile graphical interfaceprotocol differs from the graphical interface protocol of the hostcomputing platform.
 3. The non-transitory machine readable medium as inclaim 2, wherein the service process enables display of graphicalelements associated with the mobile application via a host platform userinterface framework associated with the host computing platform.
 4. Thenon-transitory machine readable medium as in claim 3, wherein invokingfunctionality provided by the service process includes modifying afunction call having parameters of a mobile user interface frameworklinked with the mobile application into parameters of the host platformuser interface framework.
 5. The non-transitory machine readable mediumas in claim 4, the operations further comprising receiving a modifiedfunction call at a forwarding proxy of the service process andforwarding the modified function call to an interface for theimplementation of the service.
 6. The non-transitory machine readablemedium as in claim 5, wherein invoking functionality provided by theservice process includes transferring data to perform the modifiedfunction call over the inter-process communication session andforwarding the data with the modified function call to the interface forthe implementation of the service.
 7. The non-transitory machinereadable medium as in claim 6, wherein the data to perform the modifiedfunction call over the inter-process communication session includesexecution state of the process of the client application.
 8. Thenon-transitory machine readable medium as in claim 1, whereinprogrammatically creating the remote instance of the implementation ofthe service via the remote proxy includes converting the remote proxy toa data type of an interface to the service exposed via the protocolinterface.
 9. A method executed by one or more processors on a hostcomputing platform, the method comprising: establishing an inter-processcommunication session from a process of a client application to aservice process on the host computing platform; accessing a protocolinterface from the process of the client application that enables accessto a service provided by the service process, wherein the protocolinterface is associated with a proxy of an implementation of theservice; programmatically creating an instance of the implementation ofthe service via the proxy; and invoking functionality provided by theservice process at the process of the client application via theinstance of the implementation of the service.
 10. The method as inclaim 9, wherein the client application is a mobile applicationconfigured to make use of a mobile graphical interface protocol and theservice process enables display of graphical elements associated withthe mobile application on a graphical interface of the host computingplatform, wherein the mobile graphical interface protocol differs fromthe graphical interface protocol of the host computing platform.
 11. Themethod as in claim 10, wherein the service process enables display ofgraphical elements associated with the mobile application via a hostplatform user interface framework associated with the host computingplatform.
 12. The method as in claim 11, wherein invoking functionalityprovided by the service process includes modifying a function callhaving parameters of a mobile user interface framework linked with themobile application into parameters of the host platform user interfaceframework.
 13. The method as in claim 12, further comprising receiving amodified function call at a forwarding proxy of the service process andforwarding the modified function call to an interface for theimplementation of the service.
 14. The method as in claim 13, whereininvoking functionality provided by the service process includestransferring data to perform the modified function call over theinter-process communication session and forwarding the data with themodified function call to the interface for the implementation of theservice.
 15. The method as in claim 14, wherein the data to perform themodified function call over the inter-process communication sessionincludes execution state of the process of the client application. 16.The method as in claim 9, wherein programmatically creating the remoteinstance of the implementation of the service via the remote proxyincludes converting the remote proxy to a data type of an interface tothe service exposed via the protocol interface.
 17. A data processingsystem comprising: a data storage device having instructions storedthereon; one or more processors to execute the instructions stored onthe data storage device, the instructions to cause the one or moreprocessors to: establish an inter-process communication session from aprocess of a client application to a service process on a host computingplatform; access a protocol interface from the process of the clientapplication that enables access to a service provided by the serviceprocess, wherein the protocol interface is associated with a proxy of animplementation of the service; programmatically create an instance ofthe implementation of the service via the proxy; and invokefunctionality provided by the service process at the process of theclient application via the instance of the implementation of theservice.
 18. The data processing system as in claim 17, wherein theclient application is a mobile application configured to make use of amobile graphical interface protocol and the service process enablesdisplay of graphical elements associated with the mobile application ona graphical interface of the host computing platform, the mobilegraphical interface protocol differs from the graphical interfaceprotocol of the host computing platform, and the service process enablesdisplay of graphical elements associated with the mobile application viaa host platform user interface framework associated with the hostcomputing platform.
 19. The data processing system as in claim 18,wherein to invoke functionality provided by the service process includesto modify a function call having parameters of a mobile user interfaceframework linked with the mobile application into parameters of the hostplatform user interface framework.
 20. The data processing system as inclaim 19, the one or more processors further to receive a modifiedfunction call at a forwarding proxy of the service process and forwardthe modified function call to an interface for the implementation of theservice.